package com.sds.annotation.processor;

import java.util.Collection;
import java.util.Collections;
import java.util.Set;

import com.sun.mirror.apt.AnnotationProcessor;
import com.sun.mirror.apt.AnnotationProcessorEnvironment;
import com.sun.mirror.apt.AnnotationProcessorFactory;
import com.sun.mirror.apt.AnnotationProcessors;
import com.sun.mirror.declaration.AnnotationTypeDeclaration;

@SuppressWarnings("deprecation")
public class LengthProcessorFactory implements AnnotationProcessorFactory{

	@Override
	public AnnotationProcessor getProcessorFor(Set<AnnotationTypeDeclaration> declarations, AnnotationProcessorEnvironment env) {
		AnnotationProcessor result;
		if (declarations.isEmpty()) {
			result = AnnotationProcessors.NO_OP;
		}
		else {
			result = new LengthProcessor(env);
		}
		return result;
	}

	@Override
	public Collection<String> supportedAnnotationTypes() {		
		return Collections.singletonList("com.sds.annotation.type.Length");
	}

	@Override
	public Collection<String> supportedOptions() {		
		return Collections.emptyList();
	}
	
}
